﻿using PetaPoco;
using PmSoft;
using PmSoft.Caching;
using System.ComponentModel;

namespace Modules.Device.Entitys
{
    /// <summary>
    /// 身份证阅读设备表
    ///</summary>
    [TableName("card_reader")]
    [Description("身份证阅读设备信息")]
    [PrimaryKey("id", AutoIncrement = true)]
    [CacheSetting(true, PropertyNamesOfArea = "CorpCode")]
    [Serializable]
    public class CardReader : IEntity
    {
        /// <summary>
        ///
        ///</summary>
        [Column("id")]
        public int Id { get; set; }

        /// <summary>
        /// 设备编码(序列号)
        ///</summary>
        [Column("device_code")]
        public string DeviceCode { get; set; }

        /// <summary>
        /// 企业编码
        ///</summary>
        [Column("corp_code")]
        public string CorpCode { get; set; }

        /// <summary>
        /// 审核人Id
        ///</summary>
        [Column("audit_user_id")]
        public int? AuditUserId { get; set; }

        /// <summary>
        /// 审核人姓名
        ///</summary>
        [Column("audit_user_name")]
        public string AuditUserName { get; set; }

        /// <summary>
        /// 审核时间
        ///</summary>
        [Column("audit_time")]
        public DateTime? AuditTime { get; set; }

        /// <summary>
        /// 状态（0：待审核，1：已审核，2：已禁用）
        ///</summary>
        [Column("status")]
        public 设备审核状态? Status { get; set; }

        /// <summary>
        /// 禁用时间
        ///</summary>
        [Column("disable_time")]
        public DateTime? DisableTime { get; set; }

        /// <summary>
        /// 禁用原因
        ///</summary>
        [Column("disable_reason")]
        public string DisableReason { get; set; }

        /// <summary>
        /// 创建时间
        ///</summary>
        [Column("create_time")]
        public DateTime? CreateTime { get; set; }

        /// <summary>
        /// 设备描述
        ///</summary>
        [Column("description")]
        public string? Description { get; set; }

        /// <summary>
        /// 设备信息
        ///</summary>
        [Column("deviceInfo")]
        public string? DeviceInfo { get; set; }

        #region IEntity 成员

        [Ignore]
        object IEntity.EntityId { get { return Id; } }

        #endregion IEntity 成员
    }
}